<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/bootstrap.min.css" />
<script src="../assets/js/jquery.min.js"></script>
<script src="../assets/js/bootstrap.min.js"></script>
<title>添加商品类型</title>
</head>
<body>
<div style="width:98%;margin-left: 1%;">
	<div class="panel panel-default">
		<div class="panel-heading">
			添加商品类型
		</div>
		<div class="panel-body">
			<form action="showGoodsType.php" method="post">
				<div class="row">
					<div class="form-group form-inline">
						<span>种类名称</span>
                        <input type="text" name="name" class="form-control">
					</div>
				</div>
				<div class="row">
					<div class="form-group form-inline">
						<span>种类等级</span>
						<input type="text" name="name" class="form-control">
					</div>
				</div>
				<div class="row">
					<div class="btn-group">
						<button type="reset" class="btn btn-default">清空</button>
						<button onclick="onRequest()" class="btn btn-default">添加</button>
					</div>
				</div>
			</form>
			<p style="color:red"></p>
		</div>
	</div>
</div>
<script>
    function onRequest(){
        var name = $("input[name='name']").val();
        // var level = $("input[name='level']").val();
        $.ajax({
            async: false,
            url: "http://localhost:80/phalapi/public/index.php?s=App.GoodsType.insertGoodsTypeInfo",
            type: "POST",
            data : {
                goodType_name:name,
                goodType_parentName:'',
            },
            dataType: "JSON",
            success: function (result) {

            },
            error: function (msg) {
                alert("错误信息：" + msg);
            }
        })
    }
</script>
</body>
</html>